from rest_framework.views import APIView
from rest_framework.generics import GenericAPIView
from rest_framework.mixins import ListModelMixin,RetrieveModelMixin

from .serializers import CourseListSerializer,CourseListDetailSerializer

from .models import Course

class CourseList(ListModelMixin,GenericAPIView):
    queryset = Course.objects.all()
    serializer_class = CourseListSerializer

    def get(self,request):
        return self.list(request)




class CourseListDetail(RetrieveModelMixin,GenericAPIView):
    queryset = Course.objects.all()
    serializer_class = CourseListDetailSerializer

    def get(self,request,*args,**kwargs):
        return self.retrieve(request,*args,**kwargs)



